import ReactDOM from 'react-dom'
import {addEvent} from './eventSystem.js'

const Demo = ()=>{
  return (
    <section
      ONCLICK={(e)=>{console.log("click section",e)}}
    >
      <h3>你好</h3>
      <button ONCLICK={(e)=>{
        e.stopPropagation()
        console.log('click button',e)
      }}>
        点击
      </button>
    </section>
  )
}

const root = document.getElementById('root')
// es 模块提供 addEvent  方法 
// root event  事件代理
addEvent(root,'click')

ReactDOM.render(<Demo />,root)
